clean up error throwing