added promt for closing tab
refactored settings.js
refactoring