add a function: convert string to resource id