change malloc to mallocRecord in record creation
modify malloc to allocRecord in record creation