Fixed searchfunction