Fix delete entity error