Fix graphExists function§