added function so that all nulls and empty strings stored as nulls