modified the refleshing for viewer of path planning