add code for switching privilege level.