updated to check if applications are already running