fixed issue in scoring function.