fix splice to use ioutil function properly