fix removal of wrong type of shapes