code changes

new behaviors and flow changes