fixed write to named pipe bug, added 2 sec delay