update engine (fixes memory leak)