Write queue after connect windows

style fixed.