fix buf to string