change the way of getting http port