Cleanup race condition in modal create/destroy