Updated Search file to implement validation