additional check when inserting data.