Write queue after connect windows

They don't need to be this way though, you can reorganize them a bit to make it better.