use line.trim() instead