1.Add signal handler(ctrl-c)
2.Handle ctrl-d
3.Fix bugs