added priveledged mode at the end