Cleaning up the entry when closed