updated delete method and added integration tests accordingly