adjust the duration and ending the session