fixed problem where session wouldn't terminate at night