fixed bug in search component. Always the last result is used.