Search cleanups

check attributes before going to search

Closes-bug: 1208201
Change-Id: I44e966c64f7163f1b88991df61142cd4774c1817