changed how script detects if it's already running