replaced query by a view