Added missing return at search function