trying to debug search function