Added code to prevent two copies from running.