added support to preserve empty lines