Fixed index out of bound bug with player