added cleanup check