Change the execution order of setgid and setuid to avoid permission error