Set the flash policy port and add a check to the disconnect event