Working around index error