Redirect after users complete profile form

Please put below code on your theme funcation.php file

add_action('user_register','post_user_reg_redirect');
function post_user_reg_redirect( $user_id )
{           
            $url="http://example.com";          
             wp_redirect($url);
             die();     

}

error code: 523