code refactor

updated calendar if there are not events in calendar.