fix authentication and exceptions