Fixed null pointer exception in clearSearch