Fix move window not closing when working asynchroneously