Added session status check