update tx code, but still crashes