changed search function in controlles to make searching easier