Added user registration logic