fix: use of $IP in function scope needs global

I'm sorry, I somehow missed this line in yesterday's patch.