add clear old keys function