handle empty indexes