fix a bug in session cleanup