added jquery trim, and fixed search bug