improved the session provider