fixed metric bug discovered by coverity