fixing bugs after read