fix cache variable setting