fix references to different variables