fixed maxId limit
added UniqueIndex.insertIfNotExists