write createRecord method.