changing read function