Added code to prevent multiple copies of the application from running