utils.rb: fix undefined local variable bug