adding a very simple cache to avoid duplicated weakupdate. TODO: 1. more test cases. 2. more fine-grained version