check ending of session