added logging to delete function