Fixed createcomponent functionality