Adding modal window closing functionality