Try to debug '-invalid transaction handle' error in search_events sub