added plot_error