add updates to email sending and updates to fix database caching