handle edge case with blank lines