minor fix in register component function