add buffer search function.