Calculation on form submit not wokring unless i click F5

Calculation on form submit not wokring unless i click F5

I'm using the built in on succesful form submission option and running the code below but when i click submit my form just gets stuck with the blue loading icon and nothing happens until i click F5 and then the page reloads and the calculation does actually work.

i'm running the workflow as seen below.

  •  Batch Info
  • Created or Edited
  • Successful form submission
  • Calculates space used


    1. input.Space_Used = input.Area_In_Square_Meters * input.Total_Stock;