read function of driver