ESP8266 WiFi.softAPgetStationNum() not doing its job?

So using the ESP8266 in STA_AP mode, the amount of Stations connected to the AP can be figured out by running a WiFi.softAPgetStationNum() line. But let's say Alpha is my AP. And Bertha is a Client trying to connect to the AP. Before Bertha connected, Alpha said there are 0 stations connected. After Bertha connect, WiFi.softAPgetStationNum() tells me there is one station connected. But when Bertha disconnects the number won't change. And when she connects again the number also stays the same. But when I connect a new Station to the AP for example charlie, the number increases by one again? How can I make that number decrease when someone disconnects ? Or is there another way you can check the amount of Stations connected to your AP.

I researched a bit and couldn't find that much info