fix bug that throw exception when mail has calendar.