Moved check for max number of timers inside loop