condtions added to search script