adding ERROR samples detection