merge changes to set_resources() from branch to trunk