Modified functions for user registration and forgot password.