fix a bug on plot and added a line on the plot