(1)filter instances whose state is running(2) change the way of getting http port