fix key errors and regex
resolve conflict in statCalc.js