add setting api
fix bug