Remove document only if the operation is remove

The modal handler for clicks on button is executed for all operations, thus removing document on update.