Bug fix when index larger than 50