fixed multiple index errors