cleanup for editing and deletion