Move mailId variable to global scope.