simplify logic
use dump to do the quoting
fix for old ruby