Added protection to main driver.