pull out next input and match logic from select