try my own version of stringToBuffer