bugfix write raw