fix javascript errors