Flush buffers and start gui integration