lock correct db