proper network callbacks

@qinweigong 
Can we move this null check before spawning the thread?