code for user registration