index error resolved