Added error handler, arranged code of frmLocationSetting.