changed variable declaration from global to local