wrong variable scope