Fixed issue with creating a record