null check on buffer