implementation of delete method