solved a small issue with variable escaping and permissions