withInput checks for end of input