fixed javascript errors in ttt