search now works for unions
fixed bug related with hash iterations