added method for validating a user