fix query adapter