moved socket call