fixed memory leak of time plot