make sure to set search to null when buffer is reset