added the cache check, don't know how to delete stuff in buffer