Updated db update logic
updated