make one query for encounters instead of multiple
add error fix counts
Merge remote-tracking branch 'origin/master'