database validation