implemented variable to control how many obstacles are activated to prevent race conditions