modified DBManager to prevent Database collapse