fix version guards for cleanup_sessions