modify the read function