fix a bug in calc max rel score in err