fix port number validation