updated email library with many changes lost