graph func fix