add exit button, stop scanning thread after app exit

fixed background unstopable bug