make writeData public