bug fix for DB Lock