better error handling for calendar