bug fix for counting on update queries