main was fixed to work with new index