fix nil pointer issue on Settings