fix removal of custom attributes