fix maxID undefined