fixed a read forever problem