fix and refactor saving email into customers table