fix the missing scenario and refactoring