add counter to logic