corrected code to check the username correctly