Avoid undefined of trim() error, when value is empty