Changed it to beforesubmit and got it all working....
# suitescript
k
Changed it to beforesubmit and got it all working. Thanks for your help.