fixed build for FreeBSD