adapt for ruby1.9.2