fixing counters, db race condition, polling interval