fixed slowness with badly-formatted input