adding validation to line class