fix continue bug
refactoring