updated fix to affiliate histroy table bug