Missing function and wrong code for external captive portal