Fixed hanging when saving settings