Fixing bug in readData