Calling onchange only when needed.