changed demo logic to manually trigger the js api