add rtrim to ical function