fixed handling incomplete lines
fixing jshint