WP-4709 Changed to use #states handling