CON-1814 check if class exists before removing it