solved database lock problem