Leave Move To Location or Actor Task On Condition

I tried unchecking “Lock AILogic” in the wander task and this does now allow the AI to detect the player when wandering, but it also allows the AI to enter the idle state while the wander task is still running, resulting in its idle animation playing while its walking for the wander.