fix base class not set bug in enable_counter
add test for Counter base class
multiple databse support