Fix undefined: write