fixing createRecord with id bug