fix cache so it does not check parent every time, check if cache needs init