Ui fix

added trim for edit, search, and reduce undefined variable warning and errors