modified main script to end completely if update is found