moved port definition to inside if __name__