prevents less than one port and makes flash messages work