Better validation of port