replace deprecated managedQuery method