Detect end of shard