fixed indexOf check