Check data before it is inserted into the database to avoid corruption.