small fix to write