fixed javascript error -  the issue interrupts toggle edit controls