handle multiple lines correctly