fix out of index error I think