Fix deprecated managedQuery