add counting query