Try to fix string index error