replace lockfile with singleton