if the key passed is an object, cast it to string