fixed some memory leaks in settings