fix samba lookup logic