updated for local debugging
updated cache to reset if empty