fix issue with variable scope