use $sth->rows() to get number of rows.

From the DBI manpage:

'A DBI statement handle execute always returns true regardless of the number of rows affected, even it's zero." It only returns the number of rows affected for non-"SELECT" statements.'

This patch ensures that we get the proper count by calling $sth->rows() instead of relying on $sth->execute.
remove unnecessary variable.