Deleted function "confirmExit" and moved alert