Code now successfully checks for valid usernames.