improved the authentication and in particular the error reporting