add stopcall after window is closed