setting logic