fixing bad variable scope issue