Fix email and sql