add role manager
fix bugs