Fix error when generating score