Added session management, error messages