fix OS X compatibility