correct error throwing