learning curve. updated the sanitize function for adding / updating items.