switch fields for the settings and added close event