Fix ordering mistake of args, reorder other operations to match hook args order