Use indexOf properly