fix some undefined variables