fix bugs in concat for support freebsd