updated query with Arel