fix bug which prevented records from being written to datastores