Added dynamic query insertion thingy