code to gracefully handle validity of user name