Use typeof to check whether to fix calendarId