proper network callbacks

@qinweigong 
Good idea!