Added missing escaping for restore queries