Fix bugs & Change flow