refactor
if write failed, don't expect any results
logging