add test support
Refactory to handle replay sequence gap