added settings autosave, fixed bugs