the problem was that the first database connection closing would sometimes lead to the database being deleted before the other connections got going