Updated js method