changed var scope