Fixed errors

Fixed errors with the validation. Search now returns an alert error if
search term is less than 3 or left blank.