fix query element cloning