some fixes connected with concurrend db access