fix bug in detecting master process based on oldest pid