Added error handler to authcontroller