implemented deleteEntity method.