cache buffer function added