Properly asynchronously manage the windows