fix cache not being written if it doesn't exist