minor changes in inserting cookies