Added <option> element treatment to the custom function