fix type to integer for "count" variable