fix bug where we search for undefined