added correct aggregation queries
fixed conflict