Moved input trimming to clean input function
Client js -> clean input -> Fixed variable name typo