modified code for user register