fix tps calculations