searching method with indexOf