some code to save and load event of main calendar view