added sig handler & terminal echo control