Made search work when selecting foreignkey.