fix the staleFlag settings in error count calcualtion