update label function