Modify update score function