Added userdata to resource and context