make this work on FreeBSD