Fix output buffer problem again