added previous input discarding