Fixed search issues regarding error about result attribute being referenced early