Fix process exist order logic