add some workaround for FreeBSD