Fixed bug where modal pop-up was not being closed.