updated logic to only run if curl is not running