fix fram header read/write