fix the session and timeout issue