bug fix score function