fix bug

Fix bug found in the new way of metric calculation