fixed emailer and logg functions