read data correctly