fixing some stupid mistakes around setting cache