adding local cache and the corresponding changes