Added code to handle registration of new user.