Added condition in case a directory hasn't been configured