fixed graph appending on wrong place