fixed race condition in renderer
cleanup