Write queue after connect windows

I personally prefer to explicitly check for NULL.