Fixed bug on mail event compilation