Undo - Fix javascript error