fix bugs when re-pull-up gateway