fixed graph empty check