add check to removeOcc call in repair.cpp