add error throwing