improved phantom process handling