add completion function