email function update 3