fixed the issue of dealing with empty lines