delete entity function