update new function

I forgot to add a mysqli_free_result line.  I'm bad about those!