type conversion for writes