Bug fix on search