fix undefinded variables