fixing data reading bug?