fixed a bug of writing invalid pose data