fixed db connect for all bin scripts, added running stat sum fields