fixed logic with cached block