fixed a bad bug with read