Implement handle key on textField, fix some bug