check if an entity has been deactivated already before deactivating
Merge pull request #17 from chozabu/fixdelete

check if an entity has been deactivated already before deactivating