code  to check if a user is already registered or not.