use instance variable instead of local variable to fix deprecations