some variable escaping fixes