add settings and fix others bugs