method to set data, sanity check existence of data