fixed invalid frag count detection