Fixed out of index error