fixing issue with multi lines of input.   adding test to cover as well