Adapted the onlyOne option to work fine with the multiple option