end connection when stop command