[BUGFIX] Result variable can be undefined in search method