Amend cache logic