Was using filename as a key instead of key passed in by user