added encode functyion to email field