fix getting running count of instances