fixed condition when deleting a Unit
Merge pull request #574 from cbartol/develop

Fixed condition when deleting a Unit