set vars needed on error