Script now checks to see if user has cancelled it.