added clear state before run, handle test container