update database working for email