Fixed read & write functions