add safe_delete
Merge pull request #79 from dimagi/cz

add safe_delete