# jsPsych Pavlovia plugin - Problems with redirecting participants after completion

**URL:** <https://discourse.psychopy.org/t/jspsych-pavlovia-plugin-problems-with-redirecting-participants-after-completion/29783>\
**Category:** jsPsych\
**Tags:** pavlovia\
**Created:** [June 28, 2022, 1:05pm UTC](https://discourse.psychopy.org/t/jspsych-pavlovia-plugin-problems-with-redirecting-participants-after-completion/29783 "2022-06-28T13:05:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mutzkey](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@Mutzkey](https://discourse.psychopy.org/u/Mutzkey)\
**Post date:** [June 28, 2022, 1:05pm UTC](https://discourse.psychopy.org/t/jspsych-pavlovia-plugin-problems-with-redirecting-participants-after-completion/29783/1 "2022-06-28T13:05:55Z")

</div>

URL of experiment:

Description of the problem:

I am running an online experiment programmed with jsPsych and which I host on Pavlovia. Thus, I use the jsPsych Pavlovia plugin (2022.1.1) for communication with the Pavlovia server. Participants’ data is successfully uploaded to the server when they complete the experiment but I got feedback that on their side the experiment “freezes” after the last trial with the message “Please wait a moment while the data are uploaded to the [pavlovia.org](http://pavlovia.org) server…”. This prevents participants to get to the redirection URL that would send them back to Prolifics where I recruit participants (causing messages about the problem, missing completion codes for participants, and potential timed-out status if participants do not close the last page themselves).

How am I supposed to embed the proper ending of the experiment within my code?

Currently it looks the following (previous lines omitted):

1. Finish connection with pavlovia

2. Insert waiting trial to ensure upload to the server is completed

3. Redirect participants to prolific by clicking a link

4. Run experiment

So the problem seems to be that participants never make it to the waiting and redirect trial. Are all trials pushed after the pavlovia\_finish trial omitted? Am I missing some statement in the pavlovia\_finish trial (e.g., completedCallbackfunction)?

Any help or hints very appreciated!

Best  
Mutzkey
