Wifi turns off when I lock screen

Wifi option on profiles is set to Optimization ON, that means it should only turn off wifi when I’m not connected. But what is happening on my phone is that avast is turning off the wifi when screen goes off and turns back on when I unlock. How to fix this?

Update: I tried with the option Always ON and it keeps turning it off when screen locks

hey Ragoncalves, depends what is your preference. It is not clear from your feedback if the Always ON mode is what you wanted. Let us know please.