added db mutex code