Popup not close with hide()

var popup = new dhtmlXPopup({
     form: ref,
     id: 'email'
});

popup.attachHTML('E-mail já está cadastrado!');

Ajax.POST('/usuario/validar/email', {valor: ref.getInput('email').value}, function(r){
     if(r.responseText == 1){
           ref.getInput('email').style.backgroundColor = '#D9FFD9';
           email = 1;
           popup.hide();
     }else{
           ref.getInput('email').style.backgroundColor = '#FFC6C6';
           email = 0;
           popup.show('email');
     }
});

resolved :slight_smile: