Added check to see whether the daemon is running