fixed graph closing error