fix bug for dynamic search