fix some concurrency issues... hopefully :-)