update diary and fix bugs