added namespaces; added mail notifications; added log function;