Use callback for error reporting in writeAsync