Handled case when "select count ()" execute scalar returns a long instead of int