better handling of incomplete input