Fixed issue with creating records