fixed bug on isAcyclic to use proper graph object