found mistake in calling inputEnd