fixed javascript errors