added try/except handling state changes to a state that doesnt exist
Merge pull request #17 from chozabu/fixdelete

check if an entity has been deactivated already before deactivating