moved function to setting.js