added logic of delete.