changed wrong variable name from master_resource to gbl_master_resource