The variables are probably changing after the operation is done.
Try using some predefined variables, if it is correct then that is probably the case. Maybe a loop in your random generation or something, or some event being fired twice? What else is going on in the context?