fixed error throwing