modify the logic for WME usage

when error occurs, enlarge the judgement scope.