fix vars scope