make output checking more robust