Fixing create bug in createRecord method