Modified code to update entry