add const qualifier to fix compile warning about xstrdup argument