fix resource search routine