second attempt at end session fix.