add safeDelete