use RB_GC_GUARD instead of volatile