fix empty lines, use split instead of match