Moved Q reference into closures  to support Q.noConflict