Bug fixs: add privilege control