fixed the garbage reading problem