Fixed read function