Dynamic search function added