fixed up glitch where close button would delete function window