replace local variable index -> frame_index