fix for BSD