replace on count query