fix for session consistency, cleanup