Actually register completion function