minor bug fix for reading data