implemented timeout logic for processes