fix of enter bug and some rearrangement