better deleting mechanism