Corrected loadAppSettings function