fixed graph layout problem