added try except block to login route