Fixed 500 error on trying to delete a not-existent entity