fixed segfault
added buf_internals