fixed bug in data reader