fixed graph bugs