Added cache creation code