counterstring api tweak