ensure max_count is always a int