pretty minor nitpick: just show the modal at the end of the function.