Fix refactor bug in pulling out discovery sending