fix removal of custom attributes

should also remove the custom attributes