Fix javascript code error