Add buffer function for appending string