agent: Fixing similar deregister routing bug with checks