modifed staging variables to support other platforms.