revising query on model