Fix: modal buttons handler

Make sure clicking the modal close button does not execute the modal command (such as remove)