fix detect graph bug