fixes some old code