fixing changing port bug