Directory in opt should only be created if  is true