Add ip counter logic.