refactoring iva
fixed a javascript error