fixed calling out of scope variables