added changes related to unexpected termination and random moves