tweaked Regex to prevent empty lines