why do you need to test require.cache[key] here?