implemented save/update diary entry function