fix escape for ruby < 2.x