fixed check emails bug: error in foreach when no new email.