db validation bug fix