adding if method for registration and user.name