fix bug on ruby1.8.7