use readline and pipe instead of ipc