Changed GUI to use timer to close windows instead of thread sleep