Changed Association logic and added table escaping