JQuery JSTree - onsearch callback invoking the default.

JQuery JSTree - onsearch callback invoking the default.

I have an issue with JQuery JSTree onsearch callback functionality.
The first search on the nodes in the Tree always invokes the default callback within the jquery-jstree.js and not the overridden onsearch callback.
But if I expand/collapse any nodes in the tree, and then do a search, now the overridden onsearch callback gets triggered.

Can anybody help why its invoking the default onsearch callback in the first instance and not the overridden one?

Regards,
Rajesh.