database lock fix