fix compatibility on freebsd