fix handling of multiple items in the input