add compete function