fix authentication and session model