Fixed issue with indexes