some changes to fix javascript errors