added logic to throw an exception when paths but not graph is specified