fixing undefined score issue