test and bug fix for an undefined variable