Fixing error when use constructor()