fixed reading bug