index error fixed