Corrected code to properly evaluate username against database.