added launchd check to script