added try catch on logging in.