fix direct max id