add real time plot of loss value