fix attachment filename with .ics
resolve divide zero bug