Fixed if(hitEnter&&empty)

But, I could refactor my code since I just copy and pasted it from
shift-tab.