add text selection
remove unnecessary code