added db validation