some changes on search forms algorithms