Updated js handler