added handling of multiple heredocs on the same line