add setting manager
fix bugs