Check and remove old security history outside the add loop