fix some bugs for external facing deploy