Fixed bug where cache wouldn't set expiry properly