Fixed issue where model was being coverted into an array and assigned numbers as key rather than the key names