adding the session cleanup code
cleanup code