fixing issue with querying by name and application association