nvm it works but it seems to always be off by one number (like it completes setting my variable to the value before changing it in the database even though it was the first step).