fixed a read int bug