fixed error for bsd