Serailize files properly in events