fix to ending sessions