More ui work2

    Needed Mutex for importing graph.
    Because as we modify model data, the drawing code was
    being executed. thus we need some thread synchronization here.
    Also, make sure to clear the graph objects before importing.