updated and combined aaron's suspend/resume patch