fix writePPM color channel seq error