graph window closes correctly now