Show/Hide the line based on valid function