changed insert to replace to remove error when enrolling a pending