fix some bugs, make it can watch on port