Added search function calling on input change.
Added input checking.