fix missing var and bad json chars