fix bug in settings considering uninitialized variable