Code for saving an entry