fixed javascript errors.