close writeQueue