Change the way of localsettigns exception handling