link complete function with logic