added code to ensure no index out of array errs for ads
added convar for ads interval