Fix agent update profile bug