improve searchfunction