fix the order of commands.