checks if cache exists before loading instead of causing error