patch some old code