Fix javascript error