fix delete behavior when modal is open