only call terminate if process is still alive