fix db validate_logic