debugged a few lines of code around authentication