Fix socket on function for nsp