optimize code

optimize events on search input-box