avoid update call if search box is empty

Added a check to avoid update call if search box is empty.