update if logic on main