fix resource stack transformation