BUG: Fix undefined error when no search file found