How Do You Make The Picker Wheel Return The Right Information?

Hello,
I wanted to ask how do you make the picker wheel return the right information. Whenever I use the pickerWheel:getValues() command to return the information it always returns the information of the thing whatever was chosen before it. Thank you.

the code should be something like:

local theValues = pickerWheel:getValues()

print (#theValues,theValues[1].value)

When I do getValues() in the picker wheel listener function, it returns the old value of the picker wheel and not the changed new value.
I am trying to detect a change and then validate the new value. If the new value has a error then I want to enforce the correct selection using the setValue function.

to make sure that the listener is working properly add a button to print the current values of the pickerwheel instead of relying on the listener, if the values print ok, then the problem is in your listener in an event perhaps like “ended” or something like that … if the values are wrong then this should be a bug but mostly unlikely, because i’m always using the pickerwhell with no problems, but i always get the values from a button click not based on the PWheel listener