Updated the delete attachment callback function