removed GD.destroy() at end of code. 'x' button now works