using flush() here is pointless as we render the layout into a memory buffer and actually transmit the data later