add destory function,fix store buf '\0'