Further changes to query