could be a bit more defensive for the existence of key...