component: fix bug with legacy API