added add_counter method