tidied up issue with search