Added handling for non-primary calendars