fix a bug on OS X 10.6.x