Fixed error in db update process