fix javascript error