Changed "Write-Error" to "Throw"