add setting logic