fix a bug on getElementsByNameAndAttribute methods