Fixed out of index error
Fixed out of index error