add codes for quiting app by double click.