shutdown of rpcEngine now works in all cases