fix totalling malfunction