Added check for port number