Move close-output-port to right after sending serialize data