this works in irb (but not in the script code)