fixed sprite index isssue throwing error