use socket instead of pipe