Fix for session expiry bug