Revise javascript