Was ignoring return value from write