Fix last inserted id in datasource