moved options clone inside of wrap function