fix memory read error