Improve the interaction of the delete function in listings