changed name argument to key