Fix agent active check