Automatically close the software