I think I've figured out why this is happening. I call signal and then code returns and if i debug i give the engine a chance to update the variable whereas when i run it the engine may not have had a chance to update.
Is there a way to find out if a variable has been updated after a signal? I have a usecase where I need to know if the workflow engine has modified a variable or not when i execute a signal.